import { Component, OnInit, ViewChild } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { SFSchema, SFComponent } from '@delon/form';
import { HttpService } from 'lbf';
import { NzMessageService } from 'ng-zorro-antd';

@Component({
  selector: 'app-zwybpub-zwybtest',
  templateUrl: './zwybtest.component.html',
})
export class ZwybpubZwybtestComponent implements OnInit {

  constructor(private lbservice: HttpService, public msgSrv: NzMessageService,) { }

  @ViewChild('sf', { static: false }) sf: SFComponent;

  flag = false;

  schema: SFSchema;

  ngOnInit() { }

  query() {
    this.lbservice
      .lbservice('query_sfschema', {
        para: { XH: 1 },
      })
      .then(resdata => {
        if (resdata.code === 0) {
          this.msgSrv.error(resdata.errmsg);
        } else {
          this.schema = JSON.parse(resdata.message);
          this.flag = true;
        }
      });
  }

}
